package com.hx.test.repository;

import com.hx.test.domain.Person;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

public interface PersonRepository extends JpaRepository<Person,Integer> , QuerydslPredicateExecutor<Person> {

    /**
     * 若hsql 参数与方法参数顺序不一致要如下标明
     * @param id
     * @param name
     */
    @Query(value = "update Person set name = ?2 where id = ?1")
    @Modifying
    void updateNameById(Integer id,String name);

}
